package com.ly.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ly.dao.IconDao;
import com.ly.entity.Icon;
import com.ly.rep.PageRequest;
import com.ly.service.IconService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class IconServiceImpl implements IconService {
    @Resource
    private IconDao iconDao;
    @Override
    public PageInfo<Icon> queryByPage(PageRequest<Icon> pageRequest) {
        PageHelper.startPage(pageRequest.getPageNum(),pageRequest.getPageSize());
        List<Icon> iconList = iconDao.selectAll(pageRequest.getQ());
        PageInfo<Icon> iconPageInfo = new PageInfo<>(iconList);
        return iconPageInfo;
    }
}
